package common;

import util.Thread1;
import util.Thread2;

public class Tester {

	public static void main(String[] args) {
		String ss = "";
		TestCommonEntity testCommonEntity = new TestCommonEntity();
		// Thread[] threads = new Thread[1000];
		// for (int i = 0; i < 1000; i++) {
		// Thread1 thread1 = new Thread1(testCommonEntity, "thread" + i);
		// Thread thread = new Thread(thread1);
		// threads[i] = thread;
		// }
		// for(Thread thread:threads){
		// thread.start();
		// }
		// Thread1 thread1 = new Thread1(testCommonEntity, "thread" + 1);
		// Thread thread = new Thread(thread1);
		// thread.start();
		// Thread2 thread12 = new Thread2(testCommonEntity);
		// Thread thread2 = new Thread(thread12);
		// thread2.start();
		// try {
		// Thread.sleep(2000);
		// } catch (InterruptedException e) {
		// // TODO Auto-generated catch block
		// e.printStackTrace();
		// }
		// System.out.println("i:"+testCommonEntity.i);
		// try {
		// Thread.sleep(2000);
		// } catch (InterruptedException e) {
		// // TODO Auto-generated catch block
		// e.printStackTrace();
		// }
		// System.out.println("==end:" + testCommonEntity.i);
		// Thread1 thread1 = new Thread1(testCommonEntity);
		// Thread2 thread2 = new Thread2(testCommonEntity);
		// new Thread(thread1).start();
		// System.out.println("===");
		// new Thread(thread2).start();
//		new Thread(new Thread1(testCommonEntity, "1")).start();
//		new Thread(new Thread1(testCommonEntity, "2")).start();
//		new Thread(new Thread1(testCommonEntity, "3")).start();
		new Thread(new Thread1(testCommonEntity, "1")).start();
		new Thread(new Thread2(testCommonEntity, "2")).start();
//		new MyThread().start();
	}
	public synchronized void test(){
		try {
			wait();
		} catch (InterruptedException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}

}
